All Questions
44 questions
1vote
1answer
284views
Rules-engine to be improved/simplified for Efficiency (performance), Extensibility and Maintenance?
This is a simple implementation of a rules engine. I am really hating the very long MATCH/CASE function. I am wondering what kind of Design Patterns could be used there to make this code more ...
2votes
1answer
98views
Semi-generic data loading utility class
The following implements a relatively generic and modular data loading utility. It loads images from a local storage given a lookup table. The data loader is parametrized via dependency injection to ...
5votes
2answers
415views
Poker bets on Python
I'm writing poker for my bot in discord. So far I'm presenting an incomplete version of the project, which is only a betting system. The development took a lot of time, so I decided to ask for help. ...
-1votes
1answer
64views
Replacing private helper methods with global functions in Python? [closed]
In Python there is no real notion of private access. It's merely suggested by social convention with _ prepended in method names. ...
1vote
0answers
77views
Check that inputs are valid dates
I have a method in a class that accepts either a datetime or string parameter. It is shown in the last code block (I didn't include the class). A little background is that I am defining a wrapper ...
4votes
1answer
77views
Exporting a merged dataset from multiple source to a downloadable link
I'm working on a use case in hobby project where I am merging data from an external data source with an internal one and exporting that to a downloadable file The use case is exposed in an ...
1vote
0answers
54views
Scraping online store and writing to database
I'm making a project that will scrape some online store for an item, gets the data and stores it in a remote database that I have, and also able to read the database and display the data on a ...
4votes
0answers
123views
Sudoku sequence solver for non-standard constraints
This script is designed to help solve sequences in Sudoku puzzles with variant constraints (ex: Thermometer, Renban, etc.). Summary The user specifies the constraints they want applied as well as the ...
5votes
1answer
76views
Othello game in Tk
I've recently reached a milestone for my Othello clone. This is my first Python project and the farthest I've come to a full program beyond small scripts and little automations. I'd love for you to ...
2votes
2answers
49views
5votes
1answer
747views
Designing an URL Shortener
Recently I was assigned a URL shortener design problem while interviewing with a well known organization. Here is the exact problem statement: Build a simple URL shortener service that will accept a ...
2votes
1answer
183views
Stack Exchange Marathon Bot – Part 1: Bot structure
This code review is for my Stack Exchange Marathon Bot project, a Telegram bot for playing a dumb little game involving the Stack Exchange network. Since the codebase is not that small, in this post I ...
2votes
1answer
158views
Python: separation of concern User Model and User DB
I am working on a small side-project since a couple of weeks, I am using Flask but trying to use as few libraries as possible and no ORMs (for learning purposes. I am currently working on the User ...
1vote
2answers
777views
Factory / Builder Design Pattern in Python
Situation: I have implemented a factory design pattern in Python as below. There are different screens which have different configurations. One can register the screen in the factory and get the ...
3votes
2answers
802views
Python Back-end registration validation
I'm working on a personal project (Flask CRUD app) and I am currently building the user service. I am trying to use as less as libraries as possible (that's why I do not use WTF-forms for example, ...